/**
 * Copyright 2008 by Robert Konigsberg
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the same terms as Perl.
 *
 * @see http://www.perl.com/perl/misc/Artistic.html
 */
package visitor.maze;

import org.testng.annotations.Test;

@Test
public class NonRepeatingPositionVisitorTest {
  @Test
  public void test() {
    Room room1 = new Room(1);
    Room room2 = new Room(2);
    Room room3 = new Room(3);
    NonRepeatingVisitor v = new NonRepeatingVisitor() { };

    assert v.shouldVisit(room1) == true;
    assert v.shouldVisit(room2) == true;
    assert v.shouldVisit(room3) == true;

    v.visit(room1);

    assert v.shouldVisit(room1) == false;
    assert v.shouldVisit(room2) == true;
    assert v.shouldVisit(room3) == true;

    v.visit(room2);

    assert v.shouldVisit(room1) == false;
    assert v.shouldVisit(room2) == false;
    assert v.shouldVisit(room3) == true;


    v.visit(room3);

    assert v.shouldVisit(room1) == false;
    assert v.shouldVisit(room2) == false;
    assert v.shouldVisit(room3) == false;
  }
}
